#include "Protocolo.h"
#include <string>

std::string Protocolo::notToString(int not_type) {
    std::string not_type_string;

    switch (not_type) {
    case NOT_TYPE_ADD_PARTIDA:
        not_type_string = "NOT_TYPE_ADD_PARTIDA";
        break;
    case NOT_TYPE_ADD_USER:
        not_type_string = "NOT_TYPE_ADD_USER";
        break;
    case NOT_TYPE_REMOVE_GAME:
        not_type_string = "NOT_TYPE_REMOVE_GAME";
        break;
    case NOT_TYPE_ANWSER_JOIN:
        not_type_string = "NOT_TYPE_ANWSER_JOIN";
        break;
    case NOT_TYPE_START_GAME:
        not_type_string = "NOT_TYPE_START_GAME";
        break;
    case NOT_OUT_USER:
        not_type_string = "NOT_OUT_USER";
        break;
    case NOT_UPDATE_BOARD:
        not_type_string = "NOT_UPDATE_BOARD";
        break;
    case NOT_PARTIDOS:
        not_type_string = "NOT_PARTIDOS";
        break;
    case NOT_FIN_PARTIDO:
        not_type_string = "NOT_FIN_PARTIDO";
        break;
    case NOT_TYPE_INVALID_MOV:
        not_type_string = "NOT_TYPE_INVALID_MOV";
        break;
    default:
        not_type_string = "NOT_TYPE INVALIDO";
        break;
    }

    return not_type_string;
}

std::string Protocolo::reqToString(int req_type) {
    std::string req_type_string;

    switch (req_type) {
    case REQ_AUTENTICAR:
        req_type_string = "REQ_AUTENTICAR";
        break;
    case REQ_CREAR_USUARIO:
        req_type_string = "REQ_CREAR_USUARIO";
        break;
    case REQ_DESCONECTAR:
        req_type_string = "REQ_DESCONECTAR";
        break;
    case REQ_PARTIDOS:
        req_type_string = "REQ_PARTIDOS";
        break;
    case REQ_UNIR_A_PARTIDO:
        req_type_string = "REQ_UNIR_A_PARTIDO";
        break;
    case REQ_CREAR_PARTIDO:
        req_type_string = "REQ_CREAR_PARTIDO";
        break;
    case REQ_COMANDO_PARTIDO:
        req_type_string = "REQ_COMANDO_PARTIDO";
        break;
    case REQ_OUT_USER:
        req_type_string = "REQ_OUT_USER";
        break;
    default:
        req_type_string = "REQ_TYPE INVALIDO";
        break;
    }

    return req_type_string;
}
